package cn.livingCloud.dto;

import cn.livingCloud.context.Config;
import cn.livingCloud.entity.content.ImageTextReply;
import cn.livingCloud.entity.content.ReplyRule;
import cn.livingCloud.wechat.protocol.MsgType;

/**
 * Created by 唐旭 on 2015/12/26.
 */
public class ArticlesReplyRuleFormDto extends ReplyRuleFormDto {
    private ArticlesFormDto articles;

    public ArticlesReplyRuleFormDto() {
        super();
        this.setMsgType(MsgType.news);
        articles = new ArticlesFormDto();
        articles.getArticleList().add(new ArticleReplyDto());
    }

    public ArticlesReplyRuleFormDto(ReplyRule replyRule) {
        super(replyRule);
        ImageTextReply content = (ImageTextReply) replyRule.getContent();
        this.articles = new ArticlesFormDto(content);
    }

    public ArticlesFormDto getArticles() {
        return articles;
    }

    public ArticlesReplyRuleFormDto setArticles(ArticlesFormDto articles) {
        this.articles = articles;
        return this;
    }

    public String getBaseUrl() {
        return Config.getDomainUrl();
    }
}
